package com.zshan.clinic.mini.controller;


import com.zshan.clinic.admin.entity.vo.ClinicInfoWebVo;
import com.zshan.clinic.admin.service.clinic.ClinicInfoService;
import com.zshan.clinic.common.entity.HeaderDTO;
import com.zshan.clinic.common.response.RestResp;
import com.zshan.clinic.mini.annotation.Permission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 诊所信息
 */
@RestController
@RequestMapping("/clinic/info")
public class ClinicInfoController extends AbstractController {


    @Autowired
    private ClinicInfoService clinicInfoService;



    /**
     * 获取诊所信息
     * @param
     * @return
     */
    @GetMapping("/getClinicInfo")
    @Permission
    public RestResp<ClinicInfoWebVo> getClinicInfo(){
        HeaderDTO headerDTO = getHeader();
        ClinicInfoWebVo clinicInfoWebVo = clinicInfoService.getClinicInfoForWeb(headerDTO.getClinicId());
        return RestResp.SUCCESS(clinicInfoWebVo);
    }
}
